package com.ihrm.common.controller;

import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author chahua
 * @date 2022/3/27 15:00
 **/
public class BaseController {

    protected HttpServletRequest request;
    protected HttpServletResponse response;

    protected String companyId;

    // 进入控制器之前执行的方法
    @ModelAttribute
    public void setReqAndResp(HttpServletRequest request, HttpServletResponse response) {
        this.request = request;
        this.response = response;
        this.companyId = "1";
    }

    // 企业id，（暂时使用1,以后会动态获取）
//    public String parseCompanyId() {
//        return "1";
//    }

}
